<?php
/**
 * Created by PhpStorm.
 * User: Lenovo
 * Date: 2019/4/27
 * Time: 20:15
 */

namespace app\api\controller;
use app\api\model\Log;
use app\api\model\Myself as MyselfModel;
use app\api\model\IndentModel;
use app\api\model\Tixian;
use app\api\model\Yue;
class Myself extends Base
{
    //我的信息
    public function myself()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->myself($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','失败');
        }
    }
    //明细提现列表
    public function tixian()
    {
        $uid=$this->uid;//die;
        $rs=new Tixian();
        $rs=$rs->tixian($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //收款列表
    public function shoukuan()
    {
        $uid=$this->uid;//die;
        $rs=new Log();
        $rs=$rs->shoukuan($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }

    }
    //充值保证金
    public function chongzhi()
    {
        $uid=$this->uid;//die;
        $rs=new Log();
        $rs=$rs->shoukuan($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }

    }
    //个人信息修改
    public function myxinxi()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->myxinxi($uid);
        if ($rs)
        {
            AjaxReturn('1','修改成功',$rs);
        }else{
            AjaxReturn('0','修改失败');
        }
    }
    //订单列表-取消
    public function indent_cancel()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->indent_cancel($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //订单取消列表详情
    public function indent_cancel_x($tid)
    {
        $rs=new MyselfModel();
        $rs=$rs->indent_cancel_x($tid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','失败');
        }
    }
    //订单成功列表
    public function indent_success()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->indent_success($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //订单取消列表详情
    public function indent_success_x($tid)
    {
        $rs=new MyselfModel();
        $rs=$rs->indent_success_x($tid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','失败');
        }
    }
    //代收款列表
    public function indent_dai()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->indent_dai($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
      //代打款列表
    public function indent_dakuan()
    {
        $uid=$this->uid;//die;
        $rs=IndentModel::where('sid',5)->select();
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
      //待打款列表详情
    public function indent_dakuan_x($tid)
    {
        $rs=new MyselfModel();
        $rs=$rs->indent_dai_x($tid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //代收款列表详情
    public function indent_dai_x($tid)
    {
        $rs=new MyselfModel();
        $rs=$rs->indent_dai_x($tid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //保证金支出明细
    public function baomoney()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->baomoney($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //提现记录
    public function tixian_record()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->tixian_record($uid);
        if ($rs)
        {
            AjaxReturn('1','成功',$rs);
        }else{
            AjaxReturn('0','无信息',$rs);
        }
    }
    //发起提现创建订单（未测）
    public function tixian_add()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->tixian_add($uid);
        if ($rs)
        {
            AjaxReturn('1','发起成功',$rs);
        }else{
            AjaxReturn('0','失败');
        }
    }

    //充值信用额度
    public function chongmoney()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->chongmoney($uid);
        if ($rs)
        {
            AjaxReturn('1','充值成功');
        }else{
            AjaxReturn('0','充值失败');
        }
    }

    //充值记录
    public function chong_record()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->chong_record($uid);
        if ($rs)
        {
            AjaxReturn('1','查询成功',$rs);
        }else{
            AjaxReturn('0','暂无数据');
        }
    }
    //余额明细
    public function yue_details()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->yue_details($uid);
        if ($rs)
        {
            AjaxReturn('1','查询成功',$rs);
        }else{
            AjaxReturn('0','暂无信息',$rs);
        }
    }

    //保证金明细
    public function bao_details()
    {
        $uid=$this->uid;//die;
        $rs=new MyselfModel();
        $rs=$rs->bao_details($uid);
        if ($rs)
        {
            AjaxReturn('1','查询成功',$rs);
        }else{
            AjaxReturn('0','暂无信息',$rs);
        }
    }
}